#!/bin/bash
# -*- coding: utf-8 -*-


"""
知识点：文件操作
"""

file_path = "./login.txt"
# file_path = "login.txt"


# count = 3
# while count > 0:
#     user = input('user: ').strip()
#     pwd = input('pwd: ').strip()
#     with open(file_path, 'r', encoding='utf8') as f:
#         for i in f:
#             u, p = i.strip().split('|')  # ["zhangaki" "123"]
#             # print(1111, u, p, type(p))
#             if user == u and pwd == p:
#                 exit('登录成功')
#         else:
#             count -= 1
#             if count == 0:
#                 print('登录失败，你没有机会了')
#             else:
#                 print('登录失败，你还有[{}]次尝试机会'.format(count))






